package com.neusoft.controller;

import java.io.IOException;
import java.io.OutputStream;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.neusoft.util.ValidateCodeUtil;

@Controller
public class ImgController {
	
	@RequestMapping("/getImg")
	public void getImg(HttpServletRequest request,HttpServletResponse response) {
		
		OutputStream out;
		try {
			out = response.getOutputStream();
			String scode = ValidateCodeUtil.getNewCode(out);
			request.getSession().setAttribute("scode", scode);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}

}
